project(libtest)

#add_executable(${PROJECT_NAME}
#        Hello.cpp
#        Hello.h
#        )

#同时构建相同名称的动态库和静态库
add_library(hello SHARED
        Hello.cpp
        Hello.h
        )
set_target_properties(hello PROPERTIES CLEAN_DIRECT_OUTPUT 1)

add_library(hello_static STATIC
        Hello.cpp
        Hello.h
        )
set_target_properties(hello_static PROPERTIES OUTPUT_NAME "hello")
set_target_properties(hello_static PROPERTIES CLEAN_DIRECT_OUTPUT 1)

SET_TARGET_PROPERTIES(hello PROPERTIES VERSION 1.2 SOVERSION 1)

install(TARGETS hello hello_static
        LIBRARY DESTINATION ${LIBRARY_OUTPUT_PATH}/lib
        ARCHIVE DESTINATION ${LIBRARY_OUTPUT_PATH}/lib
        )
INSTALL(FILES Hello.h DESTINATION ${LIBRARY_OUTPUT_PATH}include/hello)